﻿@{
    ViewBag.Title = "Home Page";
}

<h2>Stashy -- the simple repository</h2>
<p>
    To learn more about Stashy visit <a href="http://stashy.codeplex.com" title="Stashy project page">http://stashy.codeplex.com</a>.
</p>
<p>IStashy is a simple interface for a repository, and four example implementations.</p>
<p>You can either copy one of these four example implementations, or build your own.</p>
<p>To build your own repository using IStashy, you just need to implement these <strong>five easy methods</strong></p>
<pre>
    public interface IStashy&lt;K>
    {
        void Save&lt;T1>(T1 t1, K id); // Save object `t1`, using primary key `id`
        T1 Load&lt;T1>(K id); // Load object of type `T1`, using primary key `id`
        IEnumerable&lt;T1> LoadAll&lt;T1>(); // Load all objects of type `T1`
        void Delete&lt;T1>(K id); // Delete object of type `T1`, with primary key `id`
        K GetNewId&lt;T1>(); // return a new primary key, for use by an object of type `T1`
    }
</pre>
<p>To make it dead easy, I've provided four sample implementations.</p>
<p><a href='/Task'>Example using a File Stash</a>. (This stores objects as xml in the app_data folder, each file is identified by an integer.)</p>
<p><a href='/Smack'>Example using a Guidy File Stash</a>. (This stores objects as xml in the app_data folder, each file is identified by an Guid.)</p>
<p><a href='/Bug'>Example using a Cachy File Stash</a>. (Files are loaded at startup and cached in memory. Faster.)</p>
<p>BONUS: <a href='/Todo'>Nuidy File Stash</a>, uses 'Nuids' instead of Guids. They're fairly unique and much easier to type.</p>




